package thread;
import java.util.concurrent.ThreadPoolExecutor;

public class demo22 {
    public static void main(String[] args) {

    }
}
class Point{
    int x;
    int y;
    public Point(int x,int y){
        this.x = x;
        this.y = y;
    }
    /*public Point(int , int ) {
        //发生方法重载失败的情况
    }*/

}

class PointFactory{
    public static Point createPoint1(int x,int y){
        return new Point(x,y);
    }
    public static Point createPoint2(int r, int a){
        int x = (int) (r * Math.cos(a));
        int y = (int) (r * Math.sin(a));
        return new Point(x,y);
    }
}

